﻿using AutoDeployForSims.Entity;
using AutoDeployForSims.Model;
using AutoDeployForSims.Service;
using AutoDeployForSims.Utility;
using MyUtility.Utility;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace AutoDeployForSims.ViewModel
{
    public class StatusDisplayControlViewModel: ViewModelBase
    {
        private CallOutAppModel callOutAppModel = SingletonProvider<CallOutAppModel>.Instance;
        

        #region ViewModel

        private AppStatusEntity appStatusEnt;

        public AppStatusEntity AppStatusEnt
        {
            get { return appStatusEnt; }
            set 
            {
                appStatusEnt = value;
                RaisePropertyChanged("AppStatusEnt");
            }
        }



        #endregion

        public StatusDisplayControlViewModel()
        {
        }

        public StatusDisplayControlViewModel(AppStatusEntity AppStatusEntTemp)
        {
            AppStatusEnt = AppStatusEntTemp;
        }


        public void OpenSimPath()
        {
            string filePath = Path.GetDirectoryName(AppStatusEnt.AppPath);
            
            //打开文件夹
            System.Diagnostics.Process.Start(filePath);
        }

        public void CallOutSim()
        {
            callOutAppModel.ShowApp(AppStatusEnt.AppName, AppStatusEnt.AppPath);
        }


    }
}
